﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BattleThis.Core.Battle
{
	public class ExperienceInfluence : BattleThis.Core.Battle.IBattleInfluence
	{
		public float Calculate( BattleContext context )
		{
			if( context == null )throw new ArgumentNullException( "context" );

			if( context.Attacker.Experience.Level > context.Defender.Experience.Level )
			{
				return ( context.Attacker.Weapon.Damage * 0.5f );
			}
			else if( context.Attacker.Experience.Level == context.Defender.Experience.Level )
			{
				return 0;
			}

			return ( context.Attacker.Weapon.Damage * -0.2f );
		}

	}
}